package com.atguigu.gmall.wms.mapper;

import com.atguigu.gmall.wms.entity.WareSkuEntity;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品库存
 * 
 * @author gangge
 * @email gangge@atguigu.com
 * @date 2023-02-09 10:19:35
 */
@Mapper
public interface WareSkuMapper extends BaseMapper<WareSkuEntity> {

    List<WareSkuEntity> queryWareSkuStock(@Param("skuId")Long skuId, @Param("count")Integer count);

    int lockStock(@Param("count")Integer count, @Param("wareSkuId")Long wareSkuId);

    void releaseStock(@Param("wareSkuId")Long wareSkuId, @Param("count")Integer count);

    void updateStockAndSales(@Param("wareSkuId")Long wareSkuId, @Param("count")Integer count);
}
